/*----------------------------------------------------------------------------*/
/* Copyright 2011 http://www.kmftech.com                                      */
/*                                                                            */
/* This file is part of kmftech.                                              */
/*                                                                            */
/* kmftech is free software: you can redistribute it and/or modify it under   */
/* the terms of the GNU General Public License as published by the Free       */
/* Software Foundation, version 2 of the License, or (at your option) any     */
/* later version.                                                             */
/*                                                                            */
/* kmftech is distributed in the hope that it will be useful, but WITHOUT ANY */
/* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS  */
/* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more      */
/* details.                                                                   */
/*                                                                            */
/* You should have received a copy of the GNU General Public License along    */
/* with kmftech. If not, see http://www.gnu.org/licenses/.                    */
/*----------------------------------------------------------------------------*/


/*----------------------------------------------------------------------------*/
/*---------------------------- DOCUMENT HISTORY ------------------------------*/
/* Ver: 1.0    Author: Karim Mansour                      Date: 07 June  2011 */
/* Ver: 1.1    Author: Karim Mansour                      Date: 08 June  2011 */
/* Ver: X.X    Author:                                    Date:               */
/*----------------------------------------------------------------------------*/
/*---------------------    DOCUMENT CHANGE HISTORY ---------------------------*/
/* Ver: 1.0    Change: Initial Version.                                       */
/* Ver: 1.1    Change: Changed dummy app,and used drv.h instead of drv_servo.h*/
/* Ver: X.X    Change:                                                        */
/*----------------------------------------------------------------------------*/


/*                           Needed Header Files                              */
#include "kmftech_types.h"
#include "drv.h"
#include "bsc.h"

/*                           Functions Prototypes                             */
void vd_app_start(void);
void vd_app_test(void);

/*                         Functions Implementation                           */

/*----------------------------------------------------------------------------*/
/*---------------------------- FUNCTION HEADER -------------------------------*/
/* Name       : vd_app_start                                                  */
/* Description: Start application                                             */
/* Input(s)   : Input  1: void                                                */
/* Output(s)  : Output 1: void                                                */
/* Author     : Karim Mansour                                                 */
/*----------------------------------------------------------------------------*/
void vd_app_start(void)
{
   uint8 u8Local_byte = u8_bsc_uart_read();
   vd_bsc_uart_write('[');
   vd_bsc_uart_write(u8Local_byte);
   vd_bsc_uart_write(']');
   if(u8Local_byte == 'q')
   {
     vd_drv_servo_set_angle(1,0);
   }
   else if (u8Local_byte == 'w')
   {
      vd_drv_servo_set_angle(1,45);
   }
   else if (u8Local_byte == 'e')
   {
      vd_drv_servo_set_angle(1,90);
   }
   else if (u8Local_byte == 'r')
   {
      vd_drv_servo_set_angle(1,135);
   }
   else if (u8Local_byte == 't')
   {
      vd_drv_servo_set_angle(1,180);
   }
}

/*----------------------------------------------------------------------------*/
/*---------------------------- FUNCTION HEADER -------------------------------*/
/* Name       : vd_app_test                                                   */
/* Description: Start application                                             */
/* Input(s)   : Input  1: void                                                */
/* Output(s)  : Output 1: void                                                */
/* Author     : Karim Mansour                                                 */
/*----------------------------------------------------------------------------*/
void vd_app_test(void)
{

}